#
# @lc app=leetcode.cn id=27 lang=python3
#
# [27] 移除元素
#

# @lc code=start
class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        if nums is None:
            return 0
        temp=[]
        for i in nums:
            if i ==val:
                continue
            else :
                temp.append(i)
        for i in range(len(temp)):
            nums[i]=temp[i]
        return len(temp)
# @lc code=end

